<?php  /*author Daryl Hop Yek*/
 ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Login Page</title>
<link href="mainstyles.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="login">
  <?php 
if ($_SESSION['username']=='Guest')
{
	echo "<strong>".$_SESSION['msg']."</strong>";
	echo "<form id=\"form1\" name=\"form1\" method=\"post\" action=\"index.php\">";
	echo "<label>Username:";
	echo "<input type=\"text\" name=\"username\" />";
	echo "</label>";
	echo "<label>Password:";
	echo "<input type=\"password\" name=\"password\" />";
	echo "</label>";
	echo "<p>";
	echo "<input type=\"submit\" name=\"Submit\" value=\"Login\" />\t<a href=\"register.php\"><img src=\"register.png\" width=\"60\" height=\"25\" alt=\"Register\" /></a>";
	echo "</p>";
	echo "</form>";
}
else
{
	echo "<strong>".$_SESSION['msg']."</strong>";
	echo "<p> Welcome ".$_SESSION['username']."</p>";
	echo "<p><a href=\"logout.php\">Logout</a></p>";
}
?>
</div>

</body>
</html>
